import {AMapSdk, MapView, MapType} from 'react-native-amap3d';
import {Platform} from 'react-native';
import React, {Component} from 'react';
import screen from '../../common/screen/Screen';

export default class Map extends Component {
  constructor(props) {
    super(props);
    this.state = {
      name: '地图',
    };
  }

  componentDidMount() {
    AMapSdk.init(
      Platform.select({
        android: 'c52c7169e6df23490e3114330098aaac',
        ios: '186d3464209b74effa4d8391f441f14d',
      }),
    );
  }

  render() {
    return (
      <MapView
        style={{width: screen.size.width, height: screen.size.height * 0.85}}
        mapType={MapType.Standard}
        initialCameraPosition={{
          zoom: 18,
        }}
        myLocationButtonEnabled={true}
        myLocationEnabled={true}
        labelsEnabled={true}
        zoomGesturesEnabled={true}
        scrollGesturesEnabled={true}
        rotateGesturesEnabled={true}
      />
    );
  }
}
